package com.liu.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @Author 老刘Matthew
 * @Timestamp 2022/7/10 21:31
 * @Description
 */
public class DBHandler implements LoggerFactory {

    static {

        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (Exception e) {
            logger.error("获取连接失败！", e);
        }
    }

    public synchronized static Connection getConnection() throws SQLException {

        return DriverManager.getConnection("jdbc:mysql://114.132.150.39:3306/novelsysdb?serverTimezone=UTC", "root", "Lpw12345.");

    }

}
